package org.webbase.report.pojo;

import java.util.Date;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;

import org.springframework.format.annotation.DateTimeFormat;
import org.webbase.system.pojo.Pojo;

import com.fasterxml.jackson.annotation.JsonFormat;

@Entity
@Table(name="rpt_form")
public class Form extends Pojo {
	
	public static final int USE_COLUMN_FALSE = 0; // 是否使用扩展列:否
	public static final int USE_COLUMN_TRUE = 1; // 是否使用扩展列:是
	
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(generator = "uuid")
	private String id;

	@Column(name="name",length=50,nullable=false)
	private String name;
	
	@Column(name="hsql",length=2048,nullable=false)
	private String hsql;
	
	@Column(name="description",length=256)
	private String description;
	
	@Column(name="use_column",precision=8)
	private Integer useColumn;
	
	@Temporal(TemporalType.TIMESTAMP)
	@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
	@Column(name="create_time")
	private Date createTime;
	
	@Column(name="create_user_id",length=36)
	private String createUserId;

	@Column(name="status",precision=8)
	private Integer status;
	
	@Transient
	private List<FormParam> paramList;
	@Transient
	private List<FormColumn> columnList;

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getHsql() {
		return hsql;
	}

	public void setHsql(String hsql) {
		this.hsql = hsql;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}
	
	public Integer getUseColumn() {
		return useColumn;
	}

	public void setUseColumn(Integer useColumn) {
		this.useColumn = useColumn;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public String getCreateUserId() {
		return createUserId;
	}

	public void setCreateUserId(String createUserId) {
		this.createUserId = createUserId;
	}

	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	public List<FormParam> getParamList() {
		return paramList;
	}

	public void setParamList(List<FormParam> paramList) {
		this.paramList = paramList;
	}

	public List<FormColumn> getColumnList() {
		return columnList;
	}

	public void setColumnList(List<FormColumn> columnList) {
		this.columnList = columnList;
	}
	
}